package com.englisheveryday.utils;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;

/**
 * 管理Activity的生命周期
 * @author cheney
 *
 */
public class ActivityManager {

	public static List<Activity> list = new ArrayList<Activity>();
	
	/**
	 * 添加
	 * @param activity
	 */
	public static void add(Activity activity){
		list.add(activity);
	}
	
	public static void destroy(){
		if(list==null||list.size()==0)
			return;
		for(Activity activity : list){
			activity.finish();
		}
	}
}
